package com.bawei.base.net

import com.bawei.base.Res
import com.bawei.base.bean.*
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Path
import retrofit2.http.Query

interface ApiService {
    @POST(Const.LOGIN_URL)
    suspend fun login(@Query("username")username:String,@Query("password")password:String):Res<LoginEntity>
    @GET(Const.NOTICE_URL)
    suspend fun notice(@Query("page")page:Int,@Query("size")size:Int):Res<MutableList<NoticeEntity>>
    @GET(Const.CART_URL)
    suspend fun cart(@Path("areaId")areaId:Int):Res<MutableList<CarEntity>>
    @GET(Const.MESSAGE_URL)
    suspend fun message(@Query("accessId")accessId:Int,@Query("userId")userId:Int):Res<MutableList<MessgaeEntity>>
    @POST(Const.ADDCAR_URL)
    suspend fun addCar(@Body addCarEntity: AddCarEntity):Res<String>
    @GET(Const.CARINFO_URL)
    suspend fun carInfoId(@Path("licensePlate")licensePlate:String):Res<CarDetailsEntity>
    @GET(Const.PERSONLIST_URL)
    suspend fun personList():Res<MutableList<PersonListEntity>>
    @GET(Const.DEPARTMENTLIST_URL)
    suspend fun departmentList():Res<MutableList<DepartmentEntity>>
    @GET(Const.DEPARTMENT_PERSON_NUMBER_URL)
    suspend fun departmentPersonNumber(@Query("departmentId")departmentId:Int):Res<MutableList<DepartmentPersonNumberEntity>>
    @GET(Const.ORDERS_URL)
    suspend fun order():Res<MutableList<ReqairEntity>>
    @PUT(Const.UPDATAREPAIR_URl)
    suspend fun updataRepair(@Path("id")id:Int,@Body reqairEntity:ReqairEntity):Res<ReqairEntity>
    @POST(Const.ADDREPAIR_URL)
    suspend fun addRepair(@Body addRepairEntity: AddRepairEntity):Res<ReqairEntity>
    @POST(Const.ADDPERSON_URL)
    suspend fun addPerson(@Body addPersonEntity: AddPersonEntity):Res<PersonListEntity>
    @GET(Const.NEWSLIST_URL)
    suspend fun newsList():Res<MutableList<NewsEntity>>
    @GET(Const.POLLING_URL)
    suspend fun polling():Res<MutableList<PollingEntity>>
    @GET(Const.VISIT_URL)
    suspend fun visit():Res<MutableList<VisitEntity>>
    @GET(Const.STAFF_URL)
    suspend fun staff(@Path("id")id:Int):Res<StaffEntity>
    @GET(Const.DEPARTMEENTID_URL)
    suspend fun departmentId(@Path("id")id:Int):Res<DepartmentIdEntity>
    @POST(Const.ADDVISIT_URL)
    suspend fun addVisit(@Body addVisitEntity: AddVisitEntity):Res<AddVisitEntity>
    @POST(Const.ADDNEWS_URL)
    suspend fun addNews(@Body newsEntity:NewsEntity):Res<NewsEntity>
    @GET("/api/properties")
    suspend fun house():Res<MutableList<HouseEntity>>
    @GET(Const.EQUIPMENT_URL)
    suspend fun equipment():Res<MutableList<EquipmentEntity>>
    @GET(Const.COMPANY_URL)
    suspend fun company():Res<MutableList<CompanyEntity>>
    @GET(Const.COMOANYBYID_URL)
    suspend fun companyById(@Path("id")id:Int):Res<CompanyEntity>
    @POST(Const.ADDCOMPANY_URL)
    suspend fun addCompany(@Body addCompanyEntity: AddCompanyEntity):Res<AddCompanyEntity>
    @GET(Const.USERBYID_URL)
    suspend fun userById(@Path("userId")id:Int):Res<MutableList<UserEntity>>
    @POST(Const.ADDUSERCHECK_URL)
    suspend fun addUserCheck(@Body addUserEntity: AddUserEntity):Res<UserEntity>
    @GET("/api/merchant-applications")
    suspend fun companyApply():Res<MutableList<CompanyApplyEntity>>
    @GET("/api/merchant-applications/{id}")
    suspend fun companyApplyById(@Path("id")id:Int):Res<CompanyApplyEntity>
    @GET("/api/vehicles/getProvinces}")
    suspend fun getProvinces():Res<MutableList<ProvincesEntity>>
    @POST("/api/vehicles")
    suspend fun addvehicles(@Body addVehiclesEntity: AddVehiclesEntity):Res<AddVehiclesEntity>
    @GET("/api/bills/payer/{payerId}")
    suspend fun payerById(@Path("payerId")payerId:Int):Res<MutableList<PayerEntity>>
    @GET("/api/bills/{id}")
    suspend fun payerDetailById(@Path("id")id:Int):Res<PayerDetailEntity>
    @GET("/api/charge-items/{id}")
    suspend fun payDetailById2(@Path("id")id:Int):Res<payerDetail2Entity>


}